<template>
  <layout>
    <div class="scroll-view">
      <div
        v-for="(item,i) of list"
        :key="i"
        :class="['card',{
          'current': item.current,
          'completed': item.completed
        }]"
        @click="toMoreInfo(item)"
      >
        <h3>{{item.title}}</h3>
        <p>{{item.date}}</p>
      </div>
    </div>
  </layout>
</template>

<script>
export default {
  data() {
    return {
      list: [{
        title: '2021年测评按照考核表单对象长滚屏',
        date: '2021.05.22 至 2021.05.28',
        current: false,
        completed: true,
        to: 'moreInfo'
      }, {
        title: '2021年测评单对象综台题型长滚屏',
        date: '2021.05.22 至 2021.05.28',
        current: true,
        completed: false,
        to: 'moreInfo'
      }, {
        title: '2021年考试问卷-综台卷长滚屏',
        date: '2021.05.22 至 2021.05.28',
        current: false,
        completed: false,
        to: 'moreInfo'
      }, {
        title: '2021年考试-一页一题带只是点查看',
        date: '2021.05.22 至 2021.05.28',
        current: false,
        completed: false,
        to: 'moreInfo'
      }, {
        title: '2021年推荐确定候选人且不限定范围',
        date: '2021.05.22 至 2021.05.28',
        current: false,
        completed: false,
        to: 'recommend'
      }, {
        title: '2021年表单家庭成员采集',
        date: '2021.05.22 至 2021.05.28',
        current: false,
        completed: false,
        to: 'family'
      }]
    };
  },
  methods: {
    toMoreInfo(item) {
      this.$router.push({
        name: item.to
      });
    }
  }
};
</script>

<style lang="less" scoped>
.scroll-view{
  height: 100%;
  background: #F2F2F2;
  box-sizing: border-box;
  padding: 40px;
  overflow-y: auto;
  .card{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 30px 20px;
    height: 186px;
    border-radius: 12px;
    background: url(../assets/images/icon-leave2.png) no-repeat right 40px bottom 20px,#fff;
    background-size: 44px 42px;
    box-shadow: 4px 5px 8px 3px rgba(0,0,0,.19);
    &:not(:first-child){
      margin-top: 20px;
    }
    h3,p{
      line-height: 1;
    }
    h3{
      font-size: 34px;
      color: #403836;
      font-weight: 700;
    }
    p{
      font-size: 30px;
      color: #ccc;
    }
    &.current{
      background: #009AFF;
      h3,p{
        color: #fff;
      }
    }
    &.completed{
      background-color: #B6FFB6;
      h3{
        color: #403836;
      }
      p{
        color: #ccc;
      }
    }
  }
}
</style>
